<script language="javascript">
    function change_page(i)	 {

        location.href='<?php echo PATH?>/administrator/product/index/'+i;

    }
    function uncheck(){
        for (i = 0; i < frm.length; i++)
            if (frm[i].type == "checkbox") //Kiểm tra xem có phải là checkbox ?
                if (frm[i].checked)
                    frm[i].checked = false
                else
                    frm[i].checked = true;
    }
</script>



<div class="Main_Header" align="center">QUẢN LÝ Tin tức</div>


<table style="border-collapse: collapse;"  align="center" width="750" border="1" bordercolor="#bbbbbb" cellpadding="1" cellspacing="1" >

    <form method="post" name="frm" action="">



        <tr>
            <td width="5%" height="27" ><div align="center">#ID</div></td>
            <td width="20%" >TIÊU ĐỀ </td>
            <td width="10%" ><div align="center">Hình ảnh </div></td>
            <td width="20%" align="center"> Ngày đăng</td>
            <td width="10%" ><div align="center">Xem/Sửa</div></td>
            <td width="10%" ><div align="center">Trạng Thái</div></td>

        </tr>
        <?php if (count($this->listnews))
    {
        foreach($this->listnews as $key=>$value)
        {

            ?>
            <tr>
                <td  height="15"  align="center" >
                    <input  type="checkbox" name="element[]" value="<?=$value->newsid?>" />		</td>
                <td   ><?=$value->title?></td>
                <td   ><div align="center"><img src="<?=PATH?>/media/images/news/<?=$value->image?>" height="40" width="50" border="0" /></div></td>
                <td align="center"><?=date('d-m-Y',strtotime($value->postdate))?></td>
                <td  align="center"><a href="/mymvc/administrator/news/detail/<?=$value->newsid?>">Chi tiết</a></td>

                <td  align="center"><?=($value->status==1?'Hiện':'Ẩn')?></td>

            </tr>
            <?php }?>
        <tr>

            <td align="center" colspan="7" height="30" class="button">
                <input type="button" value="Chọn tất cả" onClick="uncheck()">
                <input type="submit"   onClick="return confirm('Bạn có chắc không ?');" value="Xóa đã chọn" name="ItemDel">
            </td>

        </tr>

        <?php }
    else {?>

        <tr><td colspan="7" align="center" style="color: red;">Không có tin nào</td></tr>
        <?}
        ?>
    </form>
</table>